Skip to main content

All Questions

3votes
2answers
401views

Count character 'a' in first n characters of indefinitely repeating string s

Problem statement: Lilah has a string, s, of lowercase English letters that she repeated infinitely many times. Given an integer, n, find and print the number of letter a's in the first n ...
Sandio's user avatar
5votes
2answers
308views

Counting valleys traversed below sea level, given elevation changes

Problem Statement: Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike he took exactly steps. For every step he ...
Sandio's user avatar
2votes
1answer
438views

Functional API wrapper written in Scala

I've been working on an small API wrapper for the GitHub API using Scala (full source on GitHub). I'm still very new to the language, so I was hoping to get some feedback about a couple of design ...
MattDs17's user avatar
2votes
2answers
614views

A Scala Maze Generator in Functional Style

I'm wondering if there is more I can do to incorporate more idiomatic scala and functional programming principles. I know the maze itself is mutable but i didn't see an easy solution to making it ...
j will's user avatar
5votes
3answers
128views

Generating a game board with squares in a rectangle

I am trying to generate a game board (similar to a Monopoly board). I am new to Scala and am thinking that there may be a better way to do this. But improvements to the code are also welcome. ...
Can't Tell's user avatar
3votes
1answer
191views

Functional SaveObject in Scala

I came across Java like Scala code that I am trying to refactor to make it functional and immutable. The first obvious flaw is that it's violating thread safety by using mutable public class level ...
user2066049's user avatar

close